import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import  '@/assets/css/login.css'
import *  as API from '@/http/api'
import axios from './http/request'
Vue.prototype.$axios=axios
import { Result } from 'element-ui'
Vue.prototype.$API=API
Vue.config.productionTip = false 



import VueQuillEditor from 'vue-quill-editor'

import * as echarts from 'echarts'
Vue.prototype.$echarts=echarts
// require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

Vue.use(VueQuillEditor)




// 处理时间戳的过滤器
Vue.filter('dateTime', function (v) {
   return Moment(v * 1000).format('YYYY-MM-DD hh:mm:ss')
 }) 

import Moment from 'moment'

 //定义等级过滤器
 Vue.filter('rank',function(v){
    console.log(v) 
    v=v+''   //改为字符串
    let result;
    switch(v){
       case '0':result='一级';break;
       case '1':result='二级';break;
       case '2':result='三级';break;
       default:result='没有这个级别';break;
    }
    return result
 })

 //已付款未付款过滤器
 Vue.filter('pay',function(v){
      v=v+''
      let pay
      switch(v){
         case '0':pay='未付款';break;
         case '1':pay='已付款';break;
         case '2':pay='没有这个哦';break;
      }
      return pay
 })




new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
